package com.lagou.controller;

import com.lagou.common.ServerResponse;
import com.lagou.service.IIndustryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@RequestMapping("industry")
public class IndustryController {

    @Autowired
    private IIndustryService iIndustryService;


    @RequestMapping(value = "countCityPosition.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<Map<String,Object>> countCityNums(){

       ServerResponse<Map<String,Object>> serverResponse =iIndustryService.countCitysData();
       return serverResponse;

    }


    @RequestMapping(value = "industryTop.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<Map<String,Object>> getIndustryTop(){
        ServerResponse<Map<String,Object>> serverResponse = iIndustryService.getIndustryTop();

        return serverResponse;

    }



    @RequestMapping(value = "industryCompare.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<Map<String,Object>> getIndustryCompare(){
        ServerResponse<Map<String,Object>> serverResponse = iIndustryService.getIndustryCompare();

        return serverResponse;

    }


    /**
     * 获取平均工资前十的城市
     * @return
     */
    @RequestMapping(value = "industryTop10.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<Map<String,Object>> getIndustryTop10(){
        ServerResponse<Map<String,Object>> serverResponse = iIndustryService.getIndustryTop10();

        return serverResponse;

    }


}
